package com.unipay.hosp.controller;

import com.unipay.common.result.Result;
import com.unipay.hosp.service.DepartmentService;
import com.unipay.vo.hosp.DepartmentVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Project: yitong_parent
 * @Author: C.yu
 * @Time: 2023-04-21 20:58:46
 * @Desc: TODO
 */
@Api(tags = "Dep相关接口")
@RestController
@RequestMapping("/unipay/hosp/department")
//@CrossOrigin
public class DepartmentController {
    @Autowired
    private DepartmentService departmentService;

    //根据医院编号，查询医院所有科室列表
    @ApiOperation(value = "根据hoscode查询所有Dep列表")
    @GetMapping("/findDeptTree/{hoscode}")
    public Result findDeptTree(@PathVariable("hoscode") String hoscode){
        List<DepartmentVo> depList = departmentService.findDeptTree(hoscode);
        return Result.ok(depList);
    }
}
